package com.apartment.own.controller;

import com.apartment.common.annotation.Log;
import com.apartment.common.core.controller.BaseController;
import com.apartment.common.core.domain.AjaxResult;
import com.apartment.common.core.page.TableDataInfo;
import com.apartment.common.enums.BusinessType;
import com.apartment.common.utils.poi.ExcelUtil;
import com.apartment.own.domain.OwnAccountDetails;
import com.apartment.own.domain.OwnCategoryEntity;
import com.apartment.own.service.IOwnAccountDetailsService;
import com.apartment.own.service.IOwnCategoryEntityService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 物品Controller
 * 
 * @author @Dog_E
 * @date 2020-08-28
 */
@RestController
@RequestMapping("/own/item")
@ApiOperation("物品")
public class OwnCategoryEntityController extends BaseController
{
    @Autowired
    private IOwnCategoryEntityService ownCategoryEntityService;

    /**
     * 查询物品列表
     */
    @GetMapping("/list")
    @ApiOperation("查询物品")
    public TableDataInfo list()
    {
        List<OwnCategoryEntity> list = ownCategoryEntityService.listWithTree();
        return getDataTable(list);
    }

    /**
     * 新增物品
     */
    @Log(title = "新增物品", businessType = BusinessType.INSERT)
    @PostMapping
    @ApiOperation("新增物品")
    public AjaxResult add(@RequestBody OwnAccountDetails ownAccountDetails)
    {
        return null;
    }

}
